<?php

	define ('DS', DIRECTORY_SEPARATOR);
	$current_path = realpath (dirname (__FILE__));
	$path_parts = explode (DS, $current_path);
	array_splice ($path_parts, count($path_parts)-1, 1);
	$base_path = implode (DS, $path_parts);
	define ('ROOT_PATH', $base_path);

    require ROOT_PATH.DS.'application'.DS.'config'.DS.'config.php';
    $paths = implode(PATH_SEPARATOR,
                    array (
                    	$config['path']['libraries'],
                    	$config['path']['system'],
                    	$config['path']['models']
                    ));
    set_include_path($paths);
    require 'InitApplication.php';

    $boot = new InitApplication();
    $boot->run($config);